import { GlobalFunction } from "../../Script/base/GlobalFunction";

const {ccclass, property} = cc._decorator;

@ccclass
export default class NewClass extends cc.Component {

    @property(cc.Label)
    label: cc.Label = null;
    @property({displayName:"初始大小"})
    startScale: number = 0.5;

    async play(num:string){
        this.label.string = num;
        this.node.scale = this.startScale;
        var tween = new cc.Tween();
        tween.target(this.node)
            .to(0.3, {scale: 1, position:cc.v2(this.node.position.x, this.node.position.y+50)}, null)
            .to(0.3, {opacity:0}, null)
            .call(function(){
                this.node.destroy();
            }.bind(this))
            .start();
    }
}
